package com.javalab._6feature._1enum;

public enum OperatorV2 {
    ADD("加","+"),
    SUBTRACT("减","-"),
    MULTIPLY("乘","*"),
    DIVIDE("除","/"),
    UNKNOWN("未知","unknown");
    private String name;
    private String value;
    OperatorV2(String name, String value) {
        this.name = name;
        this.value = value;
    }
    public static OperatorV2 parse(String t) {
        if (t == null) {
            return UNKNOWN;
        }
        for (OperatorV2 value : values()) {
            if (value.value.equals(t)) {
                return value;
            }
        }
        return UNKNOWN;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }
}
